```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java Object类深度解析</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .method-tag {
            position: absolute;
            top: -12px;
            right: 20px;
            background-color: #4f46e5;
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .code-block {
            background-color: #f8fafc;
            border-left: 4px solid #4f46e5;
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 3.5rem;
            line-height: 0.8;
            margin-right: 1rem;
            color: #4f46e5;
            font-weight: 700;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 sm:px-6 lg:px-8">
        <div class="max-w-7xl mx-auto">
            <div class="flex flex-col items-center text-center">
                <div class="w-24 h-24 bg-white rounded-full flex items-center justify-center mb-6 shadow-lg">
                    <i class="fab fa-java text-5xl text-indigo-600"></i>
                </div>
                <h1 class="text-4xl md:text-5xl font-bold mb-4">Java Object类深度解析</h1>
                <p class="text-xl md:text-2xl max-w-3xl opacity-90 mb-8">探索Java面向对象编程的基石 - 所有类的超类</p>
                <div class="flex space-x-4">
                    <a href="#methods" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-opacity-90 transition">
                        <i class="fas fa-list-ul mr-2"></i>核心方法
                    </a>
                    <a href="#concepts" class="bg-indigo-800 bg-opacity-50 text-white px-6 py-3 rounded-lg font-medium hover:bg-opacity-70 transition">
                        <i class="fas fa-project-diagram mr-2"></i>关系图谱
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Intro Section -->
    <section class="py-12 px-4 sm:px-6 lg:px-8">
        <div class="max-w-4xl mx-auto">
            <p class="text-xl text-gray-700 mb-8 drop-cap">
                Object 类是 Java 中所有类的根类，几乎所有的类都直接或间接继承自 Object 类。Object 类提供了一些通用的方法，这些方法可以被所有类继承和使用。理解这些方法对于掌握 Java 面向对象编程至关重要。
            </p>
            <div class="bg-indigo-50 border-l-4 border-indigo-500 p-4 mb-8 rounded">
                <div class="flex">
                    <div class="flex-shrink-0 text-indigo-500">
                        <i class="fas fa-info-circle text-xl"></i>
                    </div>
                    <div class="ml-3">
                        <h3 class="text-sm font-medium text-indigo-800">你知道吗？</h3>
                        <div class="mt-2 text-sm text-indigo-700">
                            <p>Java 中只有 8 种基本数据类型不是对象，所有其他类型都是 Object 类的子类，包括数组。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Methods Section -->
    <section id="methods" class="py-12 px-4 sm:px-6 lg:px-8 bg-white">
        <div class="max-w-4xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12">Object 类核心方法详解</h2>
            
            <!-- Method 1 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">比较</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">equals(Object obj)</h3>
                    <p class="text-gray-700 mb-6">用于比较两个对象的内容是否相等。默认实现是比较两个对象的内存地址是否相等（即是否是同一个对象）。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">在自定义类中，如果需要基于对象的内容进行比较，需要重写 <code class="bg-gray-100 px-2 py-1 rounded">equals</code> 方法。例如，比较两个学生对象时，可能希望比较它们的学号或姓名，而不是它们的内存地址。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="code-block p-4 rounded-lg mb-4 overflow-x-auto">
                        <pre><code>@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || getClass() != obj.getClass()) {
        return false;
    }
    Student student = (Student) obj;
    return this.id.equals(student.id);
}</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- Method 2 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">哈希</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">hashCode()</h3>
                    <p class="text-gray-700 mb-6">返回对象的哈希码值，哈希码是一个整数，通常用来提高在哈希表（如 <code class="bg-gray-100 px-2 py-1 rounded">HashMap</code>）中的查找速度。默认实现基于对象的内存地址生成哈希码。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">当在哈希表中存储对象时（如 <code class="bg-gray-100 px-2 py-1 rounded">HashMap</code>, <code class="bg-gray-100 px-2 py-1 rounded">HashSet</code>），需要重写 <code class="bg-gray-100 px-2 py-1 rounded">hashCode</code> 方法，并且通常需要与 <code class="bg-gray-100 px-2 py-1 rounded">equals</code> 方法一起重写，以保证相等的对象具有相同的哈希码。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="code-block p-4 rounded-lg mb-4 overflow-x-auto">
                        <pre><code>@Override
public int hashCode() {
    return Objects.hash(id);
}</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- Method 3 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">字符串</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">toString()</h3>
                    <p class="text-gray-700 mb-6">返回对象的字符串表示形式。默认实现返回类名和对象的哈希码。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">通常在自定义类中，重写 <code class="bg-gray-100 px-2 py-1 rounded">toString</code> 方法，以提供更有意义的对象信息，如打印日志或调试时展示对象的内容。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="code-block p-4 rounded-lg mb-4 overflow-x-auto">
                        <pre><code>@Override
public String toString() {
    return "Student{id='" + id + "', name='" + name + "'}";
}</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- Method 4 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">反射</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">getClass()</h3>
                    <p class="text-gray-700 mb-6">返回对象的运行时类（<code class="bg-gray-100 px-2 py-1 rounded">Class</code> 对象）。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">通常用于反射机制中，以获取类的信息，如类的字段、方法、构造函数等。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="code-block p-4 rounded-lg mb-4 overflow-x-auto">
                        <pre><code>Class<?> clazz = obj.getClass();</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- Method 5 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">拷贝</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">clone()</h3>
                    <p class="text-gray-700 mb-6">创建并返回当前对象的副本。默认是浅拷贝，需要实现 <code class="bg-gray-100 px-2 py-1 rounded">Cloneable</code> 接口，并且通常需要重写此方法以实现深拷贝。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">当需要复制对象并保留其状态时，重写 <code class="bg-gray-100 px-2 py-1 rounded">clone</code> 方法，确保对象的内部状态得到正确的复制。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="code-block p-4 rounded-lg mb-4 overflow-x-auto">
                        <pre><code>@Override
protected Object clone() throws CloneNotSupportedException {
    return super.clone();
}</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- Method 6 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">废弃</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">finalize()</h3>
                    <p class="text-gray-700 mb-6">在对象被垃圾回收时调用，通常用于清理资源。此方法在 Java 9 及以后的版本中已经被弃用，不建议再使用。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">以前用于在对象被销毁前执行一些清理工作，但现代 Java 开发中建议使用 <code class="bg-gray-100 px-2 py-1 rounded">try-with-resources</code> 或显式关闭资源的方式替代。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="code-block p-4 rounded-lg mb-4 overflow-x-auto">
                        <pre><code>@Override
protected void finalize() throws Throwable {
    try {
        // 释放资源
    } finally {
        super.finalize();
    }
}</code></pre>
                    </div>
                </div>
            </div>
            
            <!-- Method 7-9 -->
            <div class="relative bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <span class="method-tag">线程</span>
                <div class="p-6">
                    <h3 class="text-2xl font-bold mb-4 text-indigo-600">线程相关方法</h3>
                    
                    <h4 class="font-bold text-gray-800 mb-2">wait()</h4>
                    <p class="text-gray-700 mb-4">使当前线程等待，直到另一个线程调用 <code class="bg-gray-100 px-2 py-1 rounded">notify()</code> 或 <code class="bg-gray-100 px-2 py-1 rounded">notifyAll()</code> 方法唤醒该线程。必须在同步代码块中使用。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2">notify()</h4>
                    <p class="text-gray-700 mb-4">唤醒在此对象监视器上等待的某个线程。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2">notifyAll()</h4>
                    <p class="text-gray-700 mb-4">唤醒在此对象监视器上等待的所有线程。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>使用场景
                    </h4>
                    <p class="text-gray-700 mb-4">在多线程编程中，用于线程间的协调和通信。</p>
                    
                    <h4 class="font-bold text-gray-800 mb-2 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i>代码示例
                    </h4>
                    <div class="grid md:grid-cols-2 gap-4">
                        <div class="code-block p-4 rounded-lg overflow-x-auto">
                            <pre><code>// wait() 示例
synchronized (this) {
    while (condition) {
        wait();
    }
    // 执行其他操作
}</code></pre>
                        </div>
                        <div class="code-block p-4 rounded-lg overflow-x-auto">
                            <pre><code>// notify()/notifyAll() 示例
synchronized (this) {
    notify(); // 或 notifyAll()
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Concepts Section -->
    <section id="concepts" class="py-12 px-4 sm:px-6 lg:px-8 bg-gray-50">
        <div class="max-w-4xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12">Object类方法关系图谱</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden p-6">
                <div class="mermaid">
                    mindmap
                        root((Object))
                            基本方法
                                equals()
                                hashCode()
                                toString()
                                clone()
                                getClass()
                            线程方法
                                wait()
                                notify()
                                notifyAll()
                            废弃方法
                                finalize()
                            方法关系
                                equals()与hashCode()
                                wait()与notify()/notifyAll()
                                clone()与Cloneable
                </div>
                <div class="mt-6 text-gray-600 text-sm">
                    <p>提示：此图表展示了Object类中主要方法的分类和它们之间的关系。点击节点可以展开/折叠详细内容。</p>
                </div>
            </div>
            
            <div class="mt-8 grid md:grid-cols-2 gap-6">
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                        <i class="fas fa-link text-indigo-500 mr-2"></i>equals()与hashCode()的契约
                    </h3>
                    <p class="text-gray-700 mb-3">当重写<code class="bg-gray-100 px-2 py-1 rounded">equals()</code>方法时，必须同时重写<code class="bg-gray-100 px-2 py-1 rounded">hashCode()</code>方法，并遵循以下原则：</p>
                    <ul class="list-disc pl-5 space-y-1 text-gray-700">
                        <li>如果两个对象相等（<code class="bg-gray-100 px-2 py-1 rounded">equals()</code>返回true），它们的哈希码必须相同</li>
                        <li>如果两个对象不等，它们的哈希码不一定要不同（但不同可以提高哈希表性能）</li>
                        <li>哈希码在对象的整个生命周期中应保持一致，除非用于比较的属性发生变化</li>
                    </ul>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                        <i class="fas fa-exclamation-triangle text-yellow-500 mr-2"></i>关于finalize()的注意事项
                    </h3>
                    <p class="text-gray-700 mb-3">虽然<code class="bg-gray-100 px-2 py-1 rounded">finalize()</code>方法提供了对象被回收前的清理机制，但存在以下问题：</p>
                    <ul class="list-disc pl-5 space-y-1 text-gray-700">
                        <li>不保证及时执行（取决于GC运行时间）</li>
                        <li>可能严重影响性能</li>
                        <li>可能导致资源泄漏（如果抛出异常）</li>
                        <li>替代方案：使用<code class="bg-gray-100 px-2 py-1 rounded">AutoCloseable</code>接口和try-with-resources语句</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8 px-4 sm:px-6 lg:px-8">
        <div class="max-w-7xl mx-auto">
            <div class="flex flex-col items-center">
                <div class="text-xl font-medium text-white mb-2">技术小馆</div>
                <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition duration-150 ease-in-out">
                    <i class="fas fa-external-link-alt mr-1"></i> http://www.yuque.com/jtostring
                </a>
                <div class="mt-4 flex space-x-4">
                    <a href="#" class="text-gray-400 hover:text-white transition">
                        <i class="fab fa-github text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-white transition">
                        <i class="fab fa-twitter text-xl"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-white transition">
                        <i class="fab fa-youtube text-xl"></i>
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```